<%@ page import="activity.Serial" %>
<!DOCTYPE html>
<html>
    <head>
        <meta name="layout" content="frontend">
        <script src="${resource(dir: 'js',file: 'bootbox.min.js')}"></script>
    </head>
    <body>
        <div class="row">
            <div class="col-md-12">                
                <p>最新消息</p>
                <table>
                    <tbody>
                        <g:each in="${billboardList}" status="i" var="billboard">
                            <tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
                            <td><span class="glyphicon glyphicon-plus" style="font-size: 24px;"> </span>
                                <a onClick="bootbox.alert('${billboard.content}');">${billboard.title}</a></td>
                            </tr>
                        </g:each>
                    </tbody>
                </table>
                <!--<p>單場次活動，可勾選「多活動報名」後報名，多場次請點「我要報名」報名</p>-->
                <table>
                    <thead>
                        <tr>
                            <!-- <th>多活動報名</th> -->
                            <th>狀態</th>
                            <th>活動名稱</th>
                            <th>場次數量</th>
                            <th>時間起迄</th>
                            <th>已報/可報/候補名額</th>
                            <th>報名起迄</th>
                            <th>詳細資訊</th>
                        </tr>
                    </thead>
                    <tbody>
                        <g:each in="${serialInstanceList}" status="i" var="serial">
                            <tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
                                <!-- <td><g:if test="${serial.eventCounts == 1}"><g:checkBox name="reg" value="${serial.id}" checked="false" /></g:if></td> -->
                                <td>${serial.status}</td>
                                <td><g:link action="serialFull" id="${serial.id}">${serial.name}</g:link></td>
                                <td>${serial.eventCounts}</td>
                                <td>${formatDate(format:"MM/dd",date:serial.dateStart)} ~ ${formatDate(format:"MM/dd",date:serial.dateEnd)}</td>
                                <td>${serial.registerQty}/${serial.capacityQty}/${serial.standbyQty}</td>
                                <td>${formatDate(format:"MM/dd",date:serial.regStart)} ~ ${formatDate(format:"MM/dd",date:serial.regEnd)}</td>
                                <td>
                                
                                <g:if test="${serial.status == "尚可報名"}">
                                    <g:link action="serialDetail" id="${serial.id}">我要報名</g:link>
                                </g:if>
                                <g:elseif test="${serial.status == "候補報名"}">
                                    <g:link action="serialDetail" id="${serial.id}">我要報名</g:link>
                                </g:elseif>
                                <g:else>
                                    <g:link action="serialDetail" id="${serial.id}">顯示</g:link>
                                </g:else>

                                </td>
                                </tr>
                        </g:each>
                    </tbody>
                </table>
                <!--<div class="pagination">-->
                    <!--<m:paginate total="${serialInstanceTotal}" />-->
                <!--</div>-->
            </div>
        </div><!--/col-->
    </div><!--/row-->
</body>
</html>

